Optimal. Leaf size=134 \[ \frac {5 x}{16 a}-\frac {i a}{32 d (a-i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac {3 i}{16 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212}
\begin {gather*} \frac {i a^2}{24 d (a+i a \tan (c+d x))^3}-\frac {i a}{32 d (a-i a \tan (c+d x))^2}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {3 i}{16 d (a+i a \tan (c+d x))}+\frac {5 x}{16 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 212
Rule 3568
Rubi steps
\begin {align*} \int \frac {\cos ^4(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {\left (i a^5\right ) \text {Subst}\left (\int \frac {1}{(a-x)^3 (a+x)^4} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^5\right ) \text {Subst}\left (\int \left (\frac {1}{16 a^4 (a-x)^3}+\frac {1}{8 a^5 (a-x)^2}+\frac {1}{8 a^3 (a+x)^4}+\frac {3}{16 a^4 (a+x)^3}+\frac {3}{16 a^5 (a+x)^2}+\frac {5}{16 a^5 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a}{32 d (a-i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac {3 i}{16 d (a+i a \tan (c+d x))}-\frac {(5 i) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{16 d}\\ &=\frac {5 x}{16 a}-\frac {i a}{32 d (a-i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac {3 i}{16 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 109, normalized size = 0.81 \begin {gather*} -\frac {\sec (c+d x) (60 i (i+2 d x) \cos (c+d x)+15 \cos (3 (c+d x))+\cos (5 (c+d x))+60 i \sin (c+d x)-120 d x \sin (c+d x)+45 i \sin (3 (c+d x))+5 i \sin (5 (c+d x)))}{384 a d (-i+\tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.73, size = 102, normalized size = 0.76
method | result | size |
risch | \(\frac {5 x}{16 a}+\frac {i {\mathrm e}^{-6 i \left (d x +c \right )}}{192 d a}+\frac {i \cos \left (4 d x +4 c \right )}{32 d a}+\frac {3 \sin \left (4 d x +4 c \right )}{64 d a}+\frac {5 i \cos \left (2 d x +2 c \right )}{64 d a}+\frac {15 \sin \left (2 d x +2 c \right )}{64 d a}\) | \(96\) |
derivativedivides | \(\frac {-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{32}-\frac {3 i}{32 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{24 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}+\frac {i}{32 \left (\tan \left (d x +c \right )+i\right )^{2}}+\frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{32}+\frac {1}{8 \tan \left (d x +c \right )+8 i}}{d a}\) | \(102\) |
default | \(\frac {-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{32}-\frac {3 i}{32 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{24 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}+\frac {i}{32 \left (\tan \left (d x +c \right )+i\right )^{2}}+\frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{32}+\frac {1}{8 \tan \left (d x +c \right )+8 i}}{d a}\) | \(102\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 76, normalized size = 0.57 \begin {gather*} \frac {{\left (120 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, e^{\left (10 i \, d x + 10 i \, c\right )} - 30 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 60 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 15 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{384 \, a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.22, size = 219, normalized size = 1.63 \begin {gather*} \begin {cases} \frac {\left (- 50331648 i a^{4} d^{4} e^{16 i c} e^{4 i d x} - 503316480 i a^{4} d^{4} e^{14 i c} e^{2 i d x} + 1006632960 i a^{4} d^{4} e^{10 i c} e^{- 2 i d x} + 251658240 i a^{4} d^{4} e^{8 i c} e^{- 4 i d x} + 33554432 i a^{4} d^{4} e^{6 i c} e^{- 6 i d x}\right ) e^{- 12 i c}}{6442450944 a^{5} d^{5}} & \text {for}\: a^{5} d^{5} e^{12 i c} \neq 0 \\x \left (\frac {\left (e^{10 i c} + 5 e^{8 i c} + 10 e^{6 i c} + 10 e^{4 i c} + 5 e^{2 i c} + 1\right ) e^{- 6 i c}}{32 a} - \frac {5}{16 a}\right ) & \text {otherwise} \end {cases} + \frac {5 x}{16 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 116, normalized size = 0.87 \begin {gather*} -\frac {-\frac {30 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a} + \frac {30 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac {3 \, {\left (-15 i \, \tan \left (d x + c\right )^{2} + 38 \, \tan \left (d x + c\right ) + 25 i\right )}}{a {\left (-i \, \tan \left (d x + c\right ) + 1\right )}^{2}} - \frac {55 i \, \tan \left (d x + c\right )^{3} + 201 \, \tan \left (d x + c\right )^{2} - 255 i \, \tan \left (d x + c\right ) - 117}{a {\left (\tan \left (d x + c\right ) - i\right )}^{3}}}{192 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.72, size = 123, normalized size = 0.92 \begin {gather*} \frac {5\,x}{16\,a}+\frac {\frac {25\,\mathrm {tan}\left (c+d\,x\right )}{48\,a}+\frac {1{}\mathrm {i}}{6\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,25{}\mathrm {i}}{48\,a}+\frac {5\,{\mathrm {tan}\left (c+d\,x\right )}^3}{16\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,5{}\mathrm {i}}{16\,a}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^5\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,2{}\mathrm {i}+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________